<?php
// smarty.view.php Smarty View class implementation
// part of SiteVerse CMS (c) 2006,2007,2008 by Konstantin Boyandin <konstantin@boyandin.com>
//
// $Id: smarty.view.php 1 2009-10-03 03:22:16Z zaurum $
require_once('Smarty.class.php');

class SV_View_smarty implements iSV_View {
	private
		$s = null; // Smarty instance
	
	public function __construct($p) {
		$this->s = new Smarty();
		$this->s->template_dir = $p['templates'];
		$this->s->compile_dir  = $p['compiled'];
		$this->s->config_dir   = $p['configs'];
		$this->s->cache_dir    = $p['cache'];
	} /* __construct */
	
	public function __destruct() {
		unset($this->s);
	} /* __destruct */
	
	public function assign($n, $v = null) {
		return $this->s->assign($n, $v);
	} /* assign*/

	public function assign_by_ref($n, &$v) {
		return $this->s->assign_by_ref($n, $v);
	} /* assign_by_ref */
	
	public function display($tn) {
		return $this->s->display($tn);
	} /* display */
	
	public function fetch($tn) {
		return $this->s->fetch($tn);
	} /* fetch */
}
